using System;
using System.Collections;
using System.Data;
using NHibernate;
using NHibernate.Engine;
using NHibernate.Type;
using Rhino.Commons;

namespace KenEgozi.Com.Weblog.Tests
{
	public class MockUnitOfWorkFactory : IUnitOfWorkFactory
	{
		private ISession currentSession = new MockSession();

		public void Init()
		{
		}

		public IUnitOfWorkImplementor Create(IDbConnection maybeUserProvidedConnection, IUnitOfWorkImplementor previous)
		{
			return new MockUnitOfWorkImplementor();
		}

		public ISession CurrentSession
		{
			get { return currentSession; }
			set { currentSession = value; }
		}
	}

	public class MockUnitOfWorkImplementor : IUnitOfWorkImplementor
	{
		public void IncremementUsages()
		{
			
		}

		public IUnitOfWorkImplementor Previous
		{
			get { return this; }
		}

		public void Flush()
		{
			
		}

		public RhinoTransaction BeginTransaction()
		{
			return null;
		}

		public RhinoTransaction BeginTransaction(IsolationLevel isolationLevel)
		{
			return null;
		}

		public void TransactionalFlush()
		{
			
		}

		public void TransactionalFlush(IsolationLevel isolationLevel)
		{
			
		}

		public bool IsInActiveTransaction
		{
			get { return true; }
		}

		public void Dispose()
		{
			
		}

		#region IUnitOfWorkImplementor Members

		public void IncrementUsages()
		{
			throw new Exception("The method or operation is not implemented.");
		}

		#endregion
	}

	public class MockSession : ISession
	{
		public void Flush()
		{
			
		}

		public IDbConnection Disconnect()
		{
			return null;
		}

		public void Reconnect()
		{
			
		}

		public void Reconnect(IDbConnection connection)
		{
			
		}

		public IDbConnection Close()
		{
			return null;
		}

		public void CancelQuery()
		{
			
		}

		public bool IsDirty()
		{
			return false;
		}

		public object GetIdentifier(object obj)
		{
			return null;
		}

		public bool Contains(object obj)
		{
			return false;
		}

		public void Evict(object obj)
		{
			
		}

		public object Load(Type theType, object id, LockMode lockMode)
		{
			return null;
		}

		public object Load(Type theType, object id)
		{
			return null;
		}

		public T Load<T>(object id, LockMode lockMode)
		{
			throw new NotImplementedException();
		}

		public T Load<T>(object id)
		{
			throw new NotImplementedException();
		}

		public void Load(object obj, object id)
		{
			
		}

		public void Replicate(object obj, ReplicationMode replicationMode)
		{
			
		}

		public object Save(object obj)
		{
			return null;
		}

		public void Save(object obj, object id)
		{
			
		}

		public void SaveOrUpdate(object obj)
		{
			
		}

		public void Update(object obj)
		{
			
		}

		public void Update(object obj, object id)
		{
			
		}

		public object SaveOrUpdateCopy(object obj)
		{
			return null;
		}

		public object SaveOrUpdateCopy(object obj, object id)
		{
			return null;
		}

		public void Delete(object obj)
		{
			
		}

		public IList Find(string query)
		{
			return null;
		}

		public IList Find(string query, object value, IType type)
		{
			return null;
		}

		public IList Find(string query, object[] values, IType[] types)
		{
			return null;
		}

		public IEnumerable Enumerable(string query)
		{
			return null;
		}

		public IEnumerable Enumerable(string query, object value, IType type)
		{
			return null;
		}

		public IEnumerable Enumerable(string query, object[] values, IType[] types)
		{
			return null;
		}

		public ICollection Filter(object collection, string filter)
		{
			return null;
		}

		public ICollection Filter(object collection, string filter, object value, IType type)
		{
			return null;
		}

		public ICollection Filter(object collection, string filter, object[] values, IType[] types)
		{
			return null;
		}

		public int Delete(string query)
		{
			return 0;
		}

		public int Delete(string query, object value, IType type)
		{
			return 0;
		}

		public int Delete(string query, object[] values, IType[] types)
		{
			return 0;
		}

		public void Lock(object obj, LockMode lockMode)
		{
			
		}

		public void Refresh(object obj)
		{
			
		}

		public void Refresh(object obj, LockMode lockMode)
		{
			
		}

		public LockMode GetCurrentLockMode(object obj)
		{
			return LockMode.None;
		}

		public ITransaction BeginTransaction()
		{
			return null;
		}

		public ITransaction BeginTransaction(IsolationLevel isolationLevel)
		{
			return null;
		}

		public ICriteria CreateCriteria(Type persistentClass)
		{
			return null;
		}

		public ICriteria CreateCriteria(Type persistentClass, string alias)
		{
			return null;
		}

		public IQuery CreateQuery(string queryString)
		{
			return null;
		}

		public IQuery CreateFilter(object collection, string queryString)
		{
			return null;
		}

		public IQuery GetNamedQuery(string queryName)
		{
			return null;
		}

		public IQuery CreateSQLQuery(string sql, string returnAlias, Type returnClass)
		{
			return null;
		}

		public IQuery CreateSQLQuery(string sql, string[] returnAliases, Type[] returnClasses)
		{
			return null;
		}

		public ISQLQuery CreateSQLQuery(string queryString)
		{
			return null;
		}

		public void Clear()
		{
			
		}

		public object Get(Type clazz, object id)
		{
			return null;
		}

		public object Get(Type clazz, object id, LockMode lockMode)
		{
			return null;
		}

		public T Get<T>(object id)
		{
			throw new NotImplementedException();
		}

		public T Get<T>(object id, LockMode lockMode)
		{
			throw new NotImplementedException();
		}

		public IFilter EnableFilter(string filterName)
		{
			return null;
		}

		public IFilter GetEnabledFilter(string filterName)
		{
			return null;
		}

		public void DisableFilter(string filterName)
		{
			
		}

		public IMultiQuery CreateMultiQuery()
		{
			return null;
		}

		public ISession SetBatchSize(int batchSize)
		{
			return null;
		}

		public ISessionImplementor GetSessionImplementation()
		{
			return null;
		}

		public IMultiCriteria CreateMultiCriteria()
		{
			return null;
		}

		public FlushMode FlushMode
		{
			get { return NHibernate.FlushMode.Unspecified; }
			set {  }
		}

		public ISessionFactory SessionFactory
		{
			get { return null; }
		}

		public IDbConnection Connection
		{
			get { return null; }
		}

		public bool IsOpen
		{
			get { return false; }
		}

		public bool IsConnected
		{
			get { return false; }
		}

		public ITransaction Transaction
		{
			get { return null; }
		}

		public void Dispose()
		{
			
		}

		#region ISession Members


		public CacheMode CacheMode
		{
			get
			{
				throw new Exception("The method or operation is not implemented.");
			}
			set
			{
				throw new Exception("The method or operation is not implemented.");
			}
		}

		T ISession.Get<T>(object id, LockMode lockMode)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		T ISession.Get<T>(object id)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public string GetEntityName(object obj)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		T ISession.Load<T>(object id)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		T ISession.Load<T>(object id, LockMode lockMode)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public NHibernate.Stat.ISessionStatistics Statistics
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

		#endregion
	}
}